#include <iostream>
using namespace std;
int w[100001], tiao[100001], who[100001], ans[100001];

int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    cin >> w[i];

  for (int i = 1; i <= m; ++i) {
    char ch;
    cin >> ch;
    if (ch == 'i')
      cin >> who[i] >> tiao[i];
    else
      cin >> tiao[i];
  }
  
  int maxx = 0;
  for (int i = m; i > 0; --i)
    /* 找最后一次的个人财产变化 */   
    if (who[i] == 0)       // 更新的是全局 
      maxx = max(maxx, tiao[i]);  
    else if (ans[who[i]] == 0) // // 更新的是个人，且之前没有更新过
      ans[who[i]] = max(maxx, tiao[i]);

  for (int i = 1; i <= n; ++i)
    if (ans[i] == 0)
      ans[i] = max(w[i], maxx);

  for (int i = 1; i <= n; ++i)
    cout << ans[i] << endl;

  return 0;
}